﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace ShapeDemo.UC.WinProp
{
    /// <summary>
    /// Interaction logic for Polygon.xaml
    /// </summary>
    public partial class WinPropPolygon : UserControl
    {
        public double X
        {
            set
            {
                tbX.Text = value.ToString();
            }
        }

        public double Y
        {
            set
            {
                tbY.Text = value.ToString();
            }
        }
        
        public ListBox PointList
        {
            get
            {
                return lstPointsList;
            }
        }

        public WinPropPolygon()
        {
            InitializeComponent();
        }

        public void SetValue(ASPNETX_WPFPolygon _wpfpolygon)
        {
            PointList.Items.Clear();
            
            foreach (System.Windows.Point p in _wpfpolygon.PolygonBody.Points)
            {
                PointList.Items.Add("(" + p.X + "," + p.Y + ")");
            }
        }
    }
}
